Learning Ratpack by Dan Woods
Author:Dan Woods
Language: eng
Format: epub
Publisher: O'Reilly Media
Published: 2016-06-14T16:00:00+00:00
Here we use the StartEvent provided to the onStart method to get access to the server registry and resolve the Sql object.
This is the first introduction to working with the Sql DSL, and as you can see, the relatively simple execute call simply runs the provided SQL statement against the database.
From here on, we employ the sql.execute(..) call to bootstrap data directly into the TEST table.
The simplicity of working with databases through the Sql DSL is what makes it an appealing prospect for Groovy applications. It should be noted that the initialization that we are demonstrating in the Service is still performing blocking calls to the database. During the onStart call, it is not important that we schedule these calls to the blocking thread pool, because we will not be affecting request taking, as requests will not be accepted until all Service classes have been initialized.
When we plan to make database calls during request processing, however, we will want to ensure that blocking calls are scheduled to the blocking thread pool properly. As you are already aware of the Blocking fixture, you probably understand how we can use that within a handler to perform queries against the database. The updated code in Example 8-5 shows a get handler listing the values we have stored during initialization.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12570)
Hello! Python by Anthony Briggs(9915)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9796)
The Mikado Method by Ola Ellnestam Daniel Brolund(9778)
Dependency Injection in .NET by Mark Seemann(9339)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8297)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7763)
Grails in Action by Glen Smith Peter Ledbrook(7696)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7557)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7073)
Microservices with Go by Alexander Shuiskov(6839)
Practical Design Patterns for Java Developers by Miroslav Wengner(6760)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6700)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6413)
Angular Projects - Third Edition by Aristeidis Bampakos(6104)
The Art of Crafting User Stories by The Art of Crafting User Stories(5633)
NetSuite for Consultants - Second Edition by Peter Ries(5567)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5373)
Kotlin in Action by Dmitry Jemerov(5063)
